<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta name="description" content="&amp;#x524D;&amp;#x63D0;&amp;#xFF1A;   &amp;#x6700;&amp;#x8FD1;&amp;#x516C;&amp;#x53F8;&amp;#x8981;&amp;#x505A;&amp;#x76F4;&amp;#x64AD;&amp;#x65B9;&amp;#x9762;&amp;#x7684;APP&amp;#x5F00;&amp;#x53D1;&amp;#xFF0C;&amp;#x521A;&amp;#x63A5;&amp;#x89E6;&amp;#x5230;&amp;#x7684;&amp;#x65F6;&amp;#x5019;&amp;#">
<meta property="og:type" content="article">
<meta property="og:title" content="windows 下基于nginx和ffmpeg的rtmp流媒体服务器搭建">
<meta property="og:url" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/index.html">
<meta property="og:site_name" content="Silence潇湘夜雨">
<meta property="og:description" content="&amp;#x524D;&amp;#x63D0;&amp;#xFF1A;   &amp;#x6700;&amp;#x8FD1;&amp;#x516C;&amp;#x53F8;&amp;#x8981;&amp;#x505A;&amp;#x76F4;&amp;#x64AD;&amp;#x65B9;&amp;#x9762;&amp;#x7684;APP&amp;#x5F00;&amp;#x53D1;&amp;#xFF0C;&amp;#x521A;&amp;#x63A5;&amp;#x89E6;&amp;#x5230;&amp;#x7684;&amp;#x65F6;&amp;#x5019;&amp;#">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/1.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/2.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/3.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/4.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/5.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/6.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/7.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/8.png">
<meta property="og:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/9.png">
<meta property="og:updated_time" content="2019-08-21T08:06:47.548Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="windows 下基于nginx和ffmpeg的rtmp流媒体服务器搭建">
<meta name="twitter:description" content="&amp;#x524D;&amp;#x63D0;&amp;#xFF1A;   &amp;#x6700;&amp;#x8FD1;&amp;#x516C;&amp;#x53F8;&amp;#x8981;&amp;#x505A;&amp;#x76F4;&amp;#x64AD;&amp;#x65B9;&amp;#x9762;&amp;#x7684;APP&amp;#x5F00;&amp;#x53D1;&amp;#xFF0C;&amp;#x521A;&amp;#x63A5;&amp;#x89E6;&amp;#x5230;&amp;#x7684;&amp;#x65F6;&amp;#x5019;&amp;#">
<meta name="twitter:image" content="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/1.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/">





  <title>windows 下基于nginx和ffmpeg的rtmp流媒体服务器搭建 | Silence潇湘夜雨</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Silence潇湘夜雨</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">Android开发一枚</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home //首页"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user //关于"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags  //标签"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th //分类"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive //归档"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-schedule">
          <a href="/schedule/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-calendar //日程表"></i> <br>
            
            日程表
          </a>
        </li>
      
        
        <li class="menu-item menu-item-sitemap">
          <a href="/sitemap.xml" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-sitemap //站点地图"></i> <br>
            
            站点地图
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/08/21/windows-下基于nginx和ffmpeg的rtmp流媒体服务器搭建-1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Silence潇湘夜雨">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Silence潇湘夜雨">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">windows 下基于nginx和ffmpeg的rtmp流媒体服务器搭建</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-08-21T16:00:57+08:00">
                2019-08-21
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/ffmpeg/" itemprop="url" rel="index">
                    <span itemprop="name">ffmpeg</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  1.2k
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  7
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h3 id="&#x524D;&#x63D0;&#xFF1A;"><a href="#&#x524D;&#x63D0;&#xFF1A;" class="headerlink" title="&#x524D;&#x63D0;&#xFF1A;"></a>&#x524D;&#x63D0;&#xFF1A;</h3><p>   &#x6700;&#x8FD1;&#x516C;&#x53F8;&#x8981;&#x505A;&#x76F4;&#x64AD;&#x65B9;&#x9762;&#x7684;APP&#x5F00;&#x53D1;&#xFF0C;&#x521A;&#x63A5;&#x89E6;&#x5230;&#x7684;&#x65F6;&#x5019;&#x662F;&#x4E00;&#x8138;&#x61F5;&#x903C;&#x72B6;&#x6001;&#xFF0C;&#x7ECF;&#x8FC7;&#x4E24;&#x5929;&#x7684;&#x91C7;&#x5751;&#x586B;&#x5751;&#x7EC8;&#x4E8E;&#x641E;&#x61C2;&#x4E86;&#x76F4;&#x64AD;&#x7684;&#x6D41;&#x7A0B;&#xFF0C;&#x5728;&#x6B64;&#x8BB0;&#x5F55;&#x4E00;&#x4E0B;&#x3002;&#x4E00;&#x662F;&#x6015;&#x81EA;&#x5DF1;&#x5FD8;&#x8BB0;&#xFF0C;&#x53E6;&#x5916;&#x4E00;&#x4E2A;&#x662F;&#x7ED9;&#x5176;&#x4ED6;&#x4EBA;&#x505A;&#x4E00;&#x4E2A;&#x53C2;&#x8003;&#x5427;&#x3002;<br>ps&#xFF1A;&#x73B0;&#x5728;&#x597D;&#x591A;&#x7684;&#x6587;&#x7AE0;&#x5343;&#x7BC7;&#x4E00;&#x5F8B;&#xFF0C;&#x4E0D;&#x8D1F;&#x8D23;&#x4EFB;&#x7684;&#x590D;&#x5236;&#x7C98;&#x8D34;&#xFF0C;&#x8BA9;&#x4EBA;&#x6478;&#x4E0D;&#x7740;&#x5934;&#x8111;&#xFF0C;&#x5E76;&#x4E14;&#x8BDD;&#x8BF4;&#x7684;&#x4E0D;&#x591F;&#x7EC6;&#x81F4;&#xFF0C;&#x8BA9;&#x4EBA;&#x5F88;&#x662F;&#x5934;&#x75BC;&#x3002;</p>
<h3 id="&#x51C6;&#x5907;&#x6761;&#x4EF6;"><a href="#&#x51C6;&#x5907;&#x6761;&#x4EF6;" class="headerlink" title="&#x51C6;&#x5907;&#x6761;&#x4EF6;"></a>&#x51C6;&#x5907;&#x6761;&#x4EF6;</h3><ul>
<li><p><a href="https://link.jianshu.com?t=http%3A%2F%2Fnginx-win.ecsds.eu%2Fdownload%2Fnginx%25201.7.11.3%2520Gryphon.zip" target="_blank" rel="noopener">nginx-rtmp-module&#xFF08;&#x5E26;rtmp&#x6A21;&#x5757;&#xFF09;</a></p>
<ul>
<li><a href="https://pan.baidu.com/s/1QkD7zMgiIDhgvPI8e1GkLw" target="_blank" rel="noopener">ffmpeg</a> &#x5BC6;&#x7801;&#xFF1A;eha3</li>
<li><a href="https://pan.baidu.com/s/1MJ99kRlyaPUXkEODXMEq2w" target="_blank" rel="noopener">screencapturer</a> &#x5BC6;&#x7801;&#xFF1A;ypgz &#xFF08;&#x662F;&#x4E00;&#x4E2A;&#x865A;&#x62DF;&#x8BBE;&#x5907;&#xFF0C;&#x5728;&#x4F7F;&#x7528;FFMpeg&#x4E4B;&#x524D;&#xFF0C;&#x9700;&#x8981;&#x5B89;&#x88C5;&#xFF09;</li>
<li><a href="https://pan.baidu.com/s/1lEUwLWOGimEijEA4DEk03w" target="_blank" rel="noopener">vlc&#x64AD;&#x653E;&#x5668;</a> &#x5BC6;&#x7801;&#xFF1A;3yjf</li>
</ul>
<h6 id="&#x9996;&#x5148;"><a href="#&#x9996;&#x5148;" class="headerlink" title="&#x9996;&#x5148;"></a>&#x9996;&#x5148;</h6><p>nginx-rtmp-module&#x662F;nginx&#x7684;&#x4E00;&#x4E2A;&#x7EC4;&#x4EF6;&#xFF0C;&#x53EF;&#x4EE5;&#x81EA;&#x5DF1;&#x7F16;&#x8BD1;&#x751F;&#x6210;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x4ECE;&#x7F51;&#x4E0A;&#x4E0B;&#x8F7D;&#x3002;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x4ECE;nginx&#x5B98;&#x7F51;&#x4E0A;&#x4E0B;&#x8F7D;&#x7684;&#x7248;&#x672C;&#x662F;&#x4E0D;&#x5E26;rtmp&#x6A21;&#x5757;&#x7684;&#xFF0C;&#x4F46;&#x60A8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#xFF1A; <a href="https://link.jianshu.com?t=http%3A%2F%2Fnginx-win.ecsds.eu%2F" target="_blank" rel="noopener">http://nginx-win.ecsds.eu/</a>&#x627E;&#x5230;&#x5305;&#x542B;rtmp&#x7EC4;&#x4EF6;&#x7684;nginx&#x7248;&#x672C;&#xFF0C;&#x6BD4;&#x5982;&#xFF1A;nginx 1.7.8.1 Gryphon<br>&#x7136;&#x540E;&#xFF0C;&#x89E3;&#x538B;&#x6309;&#x4E0B;ctrl+R&#x952E;&#x8F93;&#x5165;cmd&#x6253;&#x5F00;&#x547D;&#x4EE4;&#x884C;&#x7A97;&#x53E3;&#xFF0C;&#x5207;&#x6362;&#x5230;&#x89E3;&#x538B;&#x7684;&#x8DEF;&#x5F84;&#x4E0B;&#xFF0C;&#x8F93;&#x5165;nginx -V &#x67E5;&#x770B; nginx&#x7248;&#x672C;&#xFF0C;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#x8868;&#x793A;&#x6210;&#x529F;&#xFF1A;<br><img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/1.png" alt="&#x67E5;&#x770B;nginx&#x7248;&#x672C;"></p>
</li>
</ul>
<ul>
<li><p>conf &#x4E0B;&#x7684;nginx.conf&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF08;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x9700;&#x8981;&#x81EA;&#x5DF1;&#x65B0;&#x5EFA;&#xFF09;<br>&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#x8DEF;&#x5F84;&#xFF1A;<br><img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/2.png" alt="nginx&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;"></p>
<p><strong>PS&#xFF1A;&#x4E0B;&#x56FE;&#x662F;nginx&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x9700;&#x8981;&#x81EA;&#x5DF1;&#x624B;&#x52A8;&#x521B;&#x5EFA;</strong><br><img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/3.png" alt="nginx&#x914D;&#x7F6E;&#x6587;&#x4EF6;"></p>
</li>
</ul>
<ul>
<li><p>nginx.conf&#x7684;&#x914D;&#x7F6E;&#x5185;&#x5BB9;</p>
<pre><code>  #&#x5C06;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#x62F7;&#x8D1D;&#x5230;conf/nginx.conf&#x6587;&#x4EF6;&#x4E2D;&#x3002;
#nginx&#x8FDB;&#x7A0B;&#x6570;&#xFF0C;&#x5EFA;&#x8BAE;&#x8BBE;&#x7F6E;&#x4E3A;&#x7B49;&#x4E8E;CPU&#x603B;&#x6838;&#x5FC3;&#x6570;
worker_processes  2;
#&#x5DE5;&#x4F5C;&#x6A21;&#x5F0F;&#x4E0E;&#x8FDE;&#x63A5;&#x6570;&#x4E0A;&#x9650;
 events {</code></pre><p>  &#x200B;     worker_connections  8192;</p>
<pre><code> }

 rtmp_auto_push on;

rtmp {
server {</code></pre><p>  &#x200B;    listen 1935;<br>  &#x200B;    application myapp {<br>  &#x200B;        live on;<br>  &#x200B;    }       </p>
<pre><code> }
}</code></pre></li>
<li><p>nginx&#x542F;&#x52A8;&#x65B9;&#x5F0F;<br><img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/4.png" alt="nginx&#x542F;&#x52A8;&#x65B9;&#x5F0F;"></p>
</li>
</ul>
<p>  &#x5982;&#x4E0A;&#x56FE;&#x6240;&#x793A;&#xFF1A;&#x5207;&#x6362;&#x5230;&#x4F60;&#x7684;nginx&#x5B89;&#x88C5;&#x8DEF;&#x5F84;&#x4E0B;&#x7136;&#x540E;&#x8F93;&#x5165; start nginx&#x5373;&#x53EF;&#x542F;&#x52A8;<br>  <strong>&#x6CE8;&#x610F;&#xFF1A;</strong> &#x542F;&#x52A8;&#x4E5F;&#x53EF;&#x4EE5;&#x8F93;&#x5165; nginx.exe -c conf\nginx-win-rtmp.conf&#xFF0C;&#x8FD9;&#x79CD;&#x65B9;&#x6CD5;&#x5E26;&#x6765;&#x7684;&#x95EE;&#x9898;&#x662F;&#x4E0D;&#x80FD;&#x4F18;&#x96C5;&#x9000;&#x51FA;&#xFF0C;<strong>&#x5207;&#x8BB0;&#xFF01;</strong><br>  &#x7136;&#x540E;&#x6253;&#x5F00;&#x4EFB;&#x52A1;&#x7BA1;&#x7406;&#x5668;&#x53EF;&#x4EE5;&#x770B;&#x5230;nginx&#x8FDB;&#x7A0B;&#x5DF2;&#x7ECF;&#x542F;&#x52A8;,&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#xFF1A;<br> <img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/5.png" alt="nginx&#x8FDB;&#x7A0B;"></p>
<h3 id="&#x5176;&#x6B21;&#xFF0C;&#x57FA;&#x4E8E;ffmpeg&#x7684;&#x63A8;&#x62C9;&#x6D41;&#x6D4B;&#x8BD5;"><a href="#&#x5176;&#x6B21;&#xFF0C;&#x57FA;&#x4E8E;ffmpeg&#x7684;&#x63A8;&#x62C9;&#x6D41;&#x6D4B;&#x8BD5;" class="headerlink" title="&#x5176;&#x6B21;&#xFF0C;&#x57FA;&#x4E8E;ffmpeg&#x7684;&#x63A8;&#x62C9;&#x6D41;&#x6D4B;&#x8BD5;"></a>&#x5176;&#x6B21;&#xFF0C;&#x57FA;&#x4E8E;ffmpeg&#x7684;&#x63A8;&#x62C9;&#x6D41;&#x6D4B;&#x8BD5;</h3><pre><code>    ffmpeg&#x662F;&#x4E00;&#x4E2A;&#x81EA;&#x7531;&#x8F6F;&#x4EF6;&#xFF0C;&#x5B83;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x6574;&#x5957;&#x591A;&#x5A92;&#x4F53;&#x7684;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#xFF0C;&#x4ECE;&#x91C7;&#x96C6;&#x3001;&#x7F16;&#x7801;&#x3001;&#x8F6C;&#x6362;&#x3001;&#x64AD;&#x653E;&#x5E94;&#x6709;&#x5C3D;&#x6709;&#x3002;
&#x5728;&#x6D41;&#x5A92;&#x4F53;&#x5E94;&#x7528;&#x9886;&#x57DF;&#x4E0D;&#x501F;&#x52A9; ffmpeg &#x7684;&#x529B;&#x91CF;&#xFF0C;&#x5C31;&#x597D;&#x6BD4;&#x505A; windows &#x7A0B;&#x5E8F;&#x800C;&#x4E0D;&#x7528; Visual Studio &#xFF0C;&#x505A; iOSApp 
&#x4E0D;&#x7528; XCode &#x4E00;&#x6837;&#xFF0C;&#x9700;&#x8981;&#x5F88;&#x5927;&#x7684;&#x52C7;&#x6C14;&#x3002;</code></pre><ul>
<li>ffmpeg &#x5B89;&#x88C5;<br> &#x89E3;&#x538B;ffmpeg&#x5230;&#x6307;&#x5B9A;&#x6587;&#x4EF6;&#x5939;&#x4E0B;&#xFF0C;&#x6211;&#x8FD9;&#x91CC;&#x662F;&#x5728;D&#x76D8;&#x7684;ProgramFile&#x4E0B;&#x7684;ffmpeg&#x8DEF;&#x5F84;&#xFF0C;&#x7136;&#x540E;&#x5C06;ffmpeng&#x7684;bin&#x8DEF;&#x5F84;&#x6DFB;&#x52A0;&#x5230;&#x7CFB;&#x7EDF;&#x7684;path&#x8DEF;&#x5F84;&#x4E0B;</li>
</ul>
<p> <img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/6.png" alt="FFMPEGbin&#x8DEF;&#x5F84;"><br><strong>&#x6CE8;&#x610F;&#xFF1A;</strong>&#x91CC;&#x9762;&#x7684;&#x91CC;&#x9762;&#x7684;&#x4E24;&#x4E2A;&#x89C6;&#x9891;&#x6587;&#x4EF6;&#x662F;&#x6211;&#x6DFB;&#x52A0;&#x8FDB;&#x53BB;&#x7684;&#xFF0C;&#x6CA1;&#x6709;&#x4EC0;&#x4E48;&#x4F5C;&#x7528;&#x3002;<br>&#x5C06;D:\ProgramFile\ffmpg\ffmpeg-win64\bin &#x6DFB;&#x52A0;&#x5230;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x7684;PATH&#x540E;&#x9762;&#xFF0C;&#x5F53;&#x7136;&#x8981;&#x6839;&#x636E;&#x4F60;&#x81EA;&#x5DF1;&#x7684;&#x5B89;&#x88C5;&#x8DEF;&#x5F84;&#x914D;&#x7F6E;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x3002;</p>
<ul>
<li><p>1&#x3001; ffmpeg&#x5B9E;&#x73B0;&#x5F55;&#x5C4F;&#x63A8;&#x6D41;<br>&#x6253;&#x5F00;windows&#x547D;&#x4EE4;&#x884C;&#x5728;&#x547D;&#x4EE4;&#x884C;&#x4E0B;&#x8F93;&#x5165;&#xFF1A;</p>
<pre><code>ffmpeg -f gdigrab -i desktop -r 16 -vcodec h264 -acodec aac -f flv 
rtmp://192.168.0.197/myapp/pc</code></pre><p><strong>&#x6CE8;&#x610F;:</strong> &#x8FD9;&#x662F;&#x4E00;&#x884C;&#x547D;&#x4EE4;&#x884C;&#x4E0B;&#x7684;&#xFF0C;&#x6CA1;&#x6709;&#x7A7A;&#x683C;&#xFF0C;&#x8FD9;&#x91CC;&#x662F;&#x65B9;&#x4FBF;&#x4F60;&#x4EEC;&#x67E5;&#x770B;&#x3002;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#xFF0C;&#x63A8;&#x6D41;&#x5DF2;&#x7ECF;&#x5F00;&#x59CB;&#x4E86;&#x3002;</p>
<p> <img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/7.png" alt="ffmpeg&#x63A8;&#x6D41;"></p>
</li>
<li><p>vlc&#x4E32;&#x6D41;&#x914D;&#x7F6E;<br> &#x6253;&#x5F00;vlc&#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x70B9;&#x51FB;&#x5A92;&#x4F53;&#xFF0C;&#x5728;&#x4E0B;&#x62C9;&#x6846;&#x9009;&#x9879;&#x4E2D;&#x9009;&#x4E2D;<strong>&#x6253;&#x5F00;&#x7F51;&#x7EDC;&#x4E32;&#x6D41;</strong>&#x8FD9;&#x4E00;&#x4E2A;&#x9009;&#x9879;&#xFF0C;&#x4F1A;&#x5F39;&#x51FA;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#x7684;&#x5BF9;&#x8BDD;&#x6846;&#xFF0C;&#x5728;&#x5BF9;&#x8BDD;&#x6846;&#x4E2D;&#x586B;&#x5165;&#x521A;&#x624D;&#x7B2C;&#x4E8C;&#x884C;&#x8FDE;&#x63A5;&#xFF08; rtmp://192.168.0.197/myapp/pc&#xFF09;&#x5373;&#x53EF;&#xFF0C;&#x5F53;&#x7136;&#x6211;&#x8FD9;&#x4E2A;&#x662F;&#x5728;&#x5C40;&#x57DF;&#x7F51;&#x4E0B;&#x9762;&#x7684;&#x3002;</p>
</li>
</ul>
<p><img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/8.png" alt="vlcrtmp&#x4E32;&#x6D41;&#x914D;&#x7F6E;"><br><strong>&#x89E3;&#x91CA;&#xFF1A;</strong></p>
<ul>
<li><p>1&#x3001;myapp&#x4E3A;application&#x7684;&#x540D;&#x5B57;&#xFF0C;&#x7531;nginx&#x7684;conf&#x4E2D;&#x5B9A;&#x4E49;</p>
</li>
<li><p>2&#x3001;pc&#x4E3A;&#x76F4;&#x64AD;&#x6D41;&#x7684;&#x540D;&#x5B57;&#xFF0C;&#x7531;&#x63A8;&#x9001;&#x65B9;&#x5B9A;&#x4E49;</p>
</li>
<li><p>2&#x3001;ffmpeg&#x64AD;&#x653E;&#x89C6;&#x9891;&#x6587;&#x4EF6;<br> &#x5207;&#x6362;&#x5230;&#x4FDD;&#x5B58;&#x89C6;&#x9891;&#x6587;&#x4EF6;&#x7684;&#x8DEF;&#x5F84;&#x4E0B;&#xFF0C;&#x6211;&#x8FD9;&#x91CC;&#x662F;&#x5728;nginx&#x8DEF;&#x5F84;&#x4E0B;&#xFF0C;&#x5982;&#x4E0B;&#x56FE;&#x6240;&#x793A;&#xFF1A;</p>
</li>
</ul>
<p><img src="/2019/08/21/windows-&#x4E0B;&#x57FA;&#x4E8E;nginx&#x548C;ffmpeg&#x7684;rtmp&#x6D41;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x642D;&#x5EFA;-1/9.png" alt="ffmpeg&#x89C6;&#x9891;&#x6587;&#x4EF6;"><br>&#x90A3;&#x4E48;&#x5BF9;&#x5E94;&#x7684;&#x547D;&#x4EE4;&#x5C31;&#x662F;&#x8FD9;&#x6837;&#x5199;&#xFF1A;</p>
<pre><code>ffmpeg -re -i gdiOut.avi -vcodec libx264 -acodec aac -f flv 
rtmp://192.168.0.197:1935/myapp/home</code></pre><p><strong>&#x89E3;&#x91CA;&#xFF1A;</strong></p>
<ul>
<li>1&#x3001;myapp&#x4E3A;application&#x7684;&#x540D;&#x5B57;&#xFF0C;&#x7531;nginx&#x7684;conf&#x4E2D;&#x5B9A;&#x4E49;</li>
<li>2&#x3001;home&#x4E3A;&#x76F4;&#x64AD;&#x6D41;&#x7684;&#x540D;&#x5B57;&#xFF0C;&#x7531;&#x63A8;&#x9001;&#x65B9;&#x5B9A;&#x4E49;</li>
</ul>
<h4 id="&#x6700;&#x540E;"><a href="#&#x6700;&#x540E;" class="headerlink" title="&#x6700;&#x540E;"></a>&#x6700;&#x540E;</h4><pre><code>  &#x7ECF;&#x8FC7;&#x4E24;&#x5929;&#x7684;&#x91C7;&#x5751;&#x4E0D;&#x65AD;&#x5C1D;&#x8BD5;&#x7EC8;&#x4E8E;&#x641E;&#x5B9A;&#x4E86;&#x670D;&#x52A1;&#x5668;&#x8FD9;&#x5757;&#xFF0C;&#x4E0B;&#x6765;&#x76F4;&#x64AD;&#x7684;&#x8FD8;&#x9700;&#x8981;&#x81EA;&#x5DF1;&#x53BB;&#x52AA;&#x529B;&#x5B8C;&#x6210;&#x4E86;&#x3002;&#x6211;&#x76F8;&#x4FE1;&#x6709;&#x5FD7;&#x8005;&#x4E8B;&#x7ADF;&#x6210;&#xFF0C;
&#x4E00;&#x5B9A;&#x4F1A;&#x6B7B;&#x78D5;&#x5230;&#x5E95;&#xFF0C;&#x53BB;&#x89E3;&#x51B3;&#x90A3;&#x4E2A;&#x96BE;&#x9898;&#x3002;</code></pre><h4 id="&#x81F4;&#x8C22;"><a href="#&#x81F4;&#x8C22;" class="headerlink" title="&#x81F4;&#x8C22;"></a>&#x81F4;&#x8C22;</h4><p><a href="https://www.jianshu.com/p/e5a1510de26a" target="_blank" rel="noopener">&#x7B2C;&#x4E00;&#x8BB2;&#xFF1A;win7&#x4E0B;&#x5FEB;&#x901F;&#x642D;&#x5EFA;&#x5A92;&#x4F53;&#x670D;&#x52A1;&#x5668;&#x7684;&#x65B9;&#x6CD5;</a><br><a href="https://www.jianshu.com/p/4f96e18827e2" target="_blank" rel="noopener">Nginx&#x642D;&#x5EFA;RTMP&#x63A8;&#x62C9;&#x6D41;&#x670D;&#x52A1;&#x5668;</a></p>
<h2 id="&#x53E6;&#x5916;&#x63A8;&#x8350;&#x4E00;&#x4E2A;Android&#x4EA4;&#x6D41;&#x7FA4;493180098&#xFF0C;&#x5982;&#x9700;&#x8F6C;&#x8F7D;&#x8BF7;&#x6807;&#x660E;&#x51FA;&#x5904;&#xFF0C;&#x8C22;&#x8C22;&#x3002;"><a href="#&#x53E6;&#x5916;&#x63A8;&#x8350;&#x4E00;&#x4E2A;Android&#x4EA4;&#x6D41;&#x7FA4;493180098&#xFF0C;&#x5982;&#x9700;&#x8F6C;&#x8F7D;&#x8BF7;&#x6807;&#x660E;&#x51FA;&#x5904;&#xFF0C;&#x8C22;&#x8C22;&#x3002;" class="headerlink" title="&#x53E6;&#x5916;&#x63A8;&#x8350;&#x4E00;&#x4E2A;Android&#x4EA4;&#x6D41;&#x7FA4;493180098&#xFF0C;&#x5982;&#x9700;&#x8F6C;&#x8F7D;&#x8BF7;&#x6807;&#x660E;&#x51FA;&#x5904;&#xFF0C;&#x8C22;&#x8C22;&#x3002;"></a>&#x53E6;&#x5916;&#x63A8;&#x8350;&#x4E00;&#x4E2A;Android&#x4EA4;&#x6D41;&#x7FA4;493180098&#xFF0C;&#x5982;&#x9700;&#x8F6C;&#x8F7D;&#x8BF7;&#x6807;&#x660E;&#x51FA;&#x5904;&#xFF0C;&#x8C22;&#x8C22;&#x3002;</h2>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/08/21/nexus-3.x私服配置（windows版）/" rel="next" title="nexus 3.x私服配置（windows版）">
                <i class="fa fa-chevron-left"></i> nexus 3.x私服配置（windows版）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/08/21/Ubtuntu环境变量配置/" rel="prev" title="Ubuntu环境变量配置">
                Ubuntu环境变量配置 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Silence潇湘夜雨</p>
              <p class="site-description motion-element" itemprop="description">Android开发一枚</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">55</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/muyishuangfeng" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/1e2eec6f972c" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/58df0abf61ff4b006b115e43" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-star"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://twitter.com/yangke20792452" target="_blank" title="Twitter">
                      
                        <i class="fa fa-fw fa-twitter"></i>Twitter</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#前提："><span class="nav-number">1.</span> <span class="nav-text">前提：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#准备条件"><span class="nav-number">2.</span> <span class="nav-text">准备条件</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#首先"><span class="nav-number">2.0.0.1.</span> <span class="nav-text">首先</span></a></li></ol></li></ol><li class="nav-item nav-level-3"><a class="nav-link" href="#其次，基于ffmpeg的推拉流测试"><span class="nav-number">3.</span> <span class="nav-text">其次，基于ffmpeg的推拉流测试</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#最后"><span class="nav-number">3.1.</span> <span class="nav-text">最后</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#致谢"><span class="nav-number">3.2.</span> <span class="nav-text">致谢</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#另外推荐一个Android交流群493180098，如需转载请标明出处，谢谢。"><span class="nav-number"></span> <span class="nav-text">另外推荐一个Android交流群493180098，如需转载请标明出处，谢谢。</span></a></li></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Silence潇湘夜雨</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">114.8k</span>
  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a> v5.1.4</div>




        







        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

  <!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/love.js"></script>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618},"display":{"superSample":2,"width":150,"height":300,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":false},"react":{"opacityDefault":0.5,"opacityOnHover":0.5},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
